package api02a;

import java.util.ArrayList;
import java.util.List;

public class ListDemo1 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("one");
        list.add("two");
        list.add("three");
        list.add("four");
        list.add("five");
        list.add("one");

        System.out.println("list:"+list);

        String a = list.get(2);
        list.set(5,"aaa");

        System.out.println(a);
        System.out.println(list);

        String b = list.set(1,"ooo");

        System.out.println(b);
        System.out.println(list);

    }
}
